//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS ARCZonalShift service.
///
/// Welcome to the API Reference Guide for zonal shift and zonal autoshift in Amazon Application Recovery Controller (ARC). You can start a zonal shift to move traffic for a load balancer resource away from an Availability Zone to help your application recover quickly from an impairment in an Availability Zone. For example, you can recover your application from a developer's bad code deployment or from an Amazon Web Services infrastructure failure in a single Availability Zone. You can also configure zonal autoshift for supported load balancer resources. Zonal autoshift is a capability in ARC where you authorize Amazon Web Services to shift away application resource traffic from an Availability Zone during events, on your behalf, to help reduce your time to recovery. Amazon Web Services starts an autoshift when internal telemetry indicates that there is an Availability Zone impairment that could potentially impact customers. For more information about using zonal shift and zonal autoshift, see the Amazon Application Recovery Controller Developer Guide.
public struct ARCZonalShift: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the ARCZonalShift client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "ARCZonalShift",
            serviceIdentifier: "arc-zonal-shift",
            serviceProtocol: .restjson,
            apiVersion: "2022-10-30",
            endpoint: endpoint,
            errorType: ARCZonalShiftErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Cancel an in-progress practice run zonal shift in Amazon Application Recovery Controller.
    @Sendable
    @inlinable
    public func cancelPracticeRun(_ input: CancelPracticeRunRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CancelPracticeRunResponse {
        try await self.client.execute(
            operation: "CancelPracticeRun", 
            path: "/practiceruns/{zonalShiftId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Cancel an in-progress practice run zonal shift in Amazon Application Recovery Controller.
    ///
    /// Parameters:
    ///   - zonalShiftId: The identifier of a practice run zonal shift in Amazon Application Recovery Controller that you want to cancel.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelPracticeRun(
        zonalShiftId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CancelPracticeRunResponse {
        let input = CancelPracticeRunRequest(
            zonalShiftId: zonalShiftId
        )
        return try await self.cancelPracticeRun(input, logger: logger)
    }

    /// Cancel a zonal shift in Amazon Application Recovery Controller. To cancel the zonal shift, specify the zonal shift ID. A zonal shift can be one that you've started for a resource in your Amazon Web Services account in an Amazon Web Services Region, or it can be a zonal shift started by a practice run with zonal autoshift.
    @Sendable
    @inlinable
    public func cancelZonalShift(_ input: CancelZonalShiftRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ZonalShift {
        try await self.client.execute(
            operation: "CancelZonalShift", 
            path: "/zonalshifts/{zonalShiftId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Cancel a zonal shift in Amazon Application Recovery Controller. To cancel the zonal shift, specify the zonal shift ID. A zonal shift can be one that you've started for a resource in your Amazon Web Services account in an Amazon Web Services Region, or it can be a zonal shift started by a practice run with zonal autoshift.
    ///
    /// Parameters:
    ///   - zonalShiftId: The internally-generated identifier of a zonal shift.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelZonalShift(
        zonalShiftId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ZonalShift {
        let input = CancelZonalShiftRequest(
            zonalShiftId: zonalShiftId
        )
        return try await self.cancelZonalShift(input, logger: logger)
    }

    /// A practice run configuration for zonal autoshift is required when you enable zonal autoshift. A practice run configuration includes specifications for blocked dates and blocked time windows, and for Amazon CloudWatch alarms that you create to use with practice runs. The alarms that you specify are an outcome alarm, to monitor application health during practice runs and, optionally, a blocking alarm, to block practice runs from starting. When a resource has a practice run configuration, ARC starts zonal shifts for the resource weekly, to shift traffic for practice runs. Practice runs help you to ensure that shifting away traffic from an Availability Zone during an autoshift is safe for your application. For more information, see  Considerations when you configure zonal autoshift in the Amazon Application Recovery Controller Developer Guide.
    @Sendable
    @inlinable
    public func createPracticeRunConfiguration(_ input: CreatePracticeRunConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreatePracticeRunConfigurationResponse {
        try await self.client.execute(
            operation: "CreatePracticeRunConfiguration", 
            path: "/configuration", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// A practice run configuration for zonal autoshift is required when you enable zonal autoshift. A practice run configuration includes specifications for blocked dates and blocked time windows, and for Amazon CloudWatch alarms that you create to use with practice runs. The alarms that you specify are an outcome alarm, to monitor application health during practice runs and, optionally, a blocking alarm, to block practice runs from starting. When a resource has a practice run configuration, ARC starts zonal shifts for the resource weekly, to shift traffic for practice runs. Practice runs help you to ensure that shifting away traffic from an Availability Zone during an autoshift is safe for your application. For more information, see  Considerations when you configure zonal autoshift in the Amazon Application Recovery Controller Developer Guide.
    ///
    /// Parameters:
    ///   - allowedWindows: Optionally, you can allow ARC to start practice runs for specific windows of days and times.  The format for allowed windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple allowed windows with spaces. For example, say you want to allow practice runs only on Wednesdays and Fridays from noon to 5 p.m. For this scenario, you could set the following recurring days and times as allowed windows, for example: Wed-12:00-Wed:17:00 Fri-12:00-Fri:17:00.  The allowedWindows have to start and end on the same day. Windows that span multiple days aren't supported.
    ///   - blockedDates: Optionally, you can block ARC from starting practice runs for a resource on specific calendar dates. The format for blocked dates is: YYYY-MM-DD. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Separate multiple blocked dates with spaces. For example, if you have an application update scheduled to launch on May 1, 2024, and you don't want practice runs to shift traffic away at that time, you could set a blocked date for 2024-05-01.
    ///   - blockedWindows: Optionally, you can block ARC from starting practice runs for specific windows of days and times.  The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple blocked windows with spaces. For example, say you run business report summaries three days a week. For this scenario, you could set the following recurring days and times as blocked windows, for example: Mon:00:00-Mon:10:00 Wed-20:30-Wed:21:30 Fri-20:30-Fri:21:30.  The blockedWindows have to start and end on the same day. Windows that span multiple days aren't supported.
    ///   - blockingAlarms:  Blocking alarms for practice runs are optional alarms that you can specify that block practice runs when one or more of the alarms is in an ALARM state.
    ///   - outcomeAlarms:  Outcome alarms for practice runs are alarms that you specify that end a practice run when one or more of the alarms is in an ALARM state. Configure one or more of these alarms to monitor the health of your application when traffic is shifted away from an Availability Zone during each practice run. You should configure these alarms to go into an ALARM state if you want to stop a zonal shift, to let traffic for the resource return to the original Availability Zone.
    ///   - resourceIdentifier: The identifier of the resource that Amazon Web Services shifts traffic for with a practice run zonal shift. The identifier is the Amazon Resource Name (ARN) for the resource. Amazon Application Recovery Controller currently supports enabling the following resources for zonal shift and zonal autoshift:    Amazon EC2 Auto Scaling groups     Amazon Elastic Kubernetes Service     Application Load Balancer     Network Load Balancer
    ///   - logger: Logger use during operation
    @inlinable
    public func createPracticeRunConfiguration(
        allowedWindows: [String]? = nil,
        blockedDates: [String]? = nil,
        blockedWindows: [String]? = nil,
        blockingAlarms: [ControlCondition]? = nil,
        outcomeAlarms: [ControlCondition],
        resourceIdentifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreatePracticeRunConfigurationResponse {
        let input = CreatePracticeRunConfigurationRequest(
            allowedWindows: allowedWindows, 
            blockedDates: blockedDates, 
            blockedWindows: blockedWindows, 
            blockingAlarms: blockingAlarms, 
            outcomeAlarms: outcomeAlarms, 
            resourceIdentifier: resourceIdentifier
        )
        return try await self.createPracticeRunConfiguration(input, logger: logger)
    }

    /// Deletes the practice run configuration for a resource. Before you can delete a practice run configuration for a resource., you must disable zonal autoshift for the resource. Practice runs must be configured for zonal autoshift to be enabled.
    @Sendable
    @inlinable
    public func deletePracticeRunConfiguration(_ input: DeletePracticeRunConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeletePracticeRunConfigurationResponse {
        try await self.client.execute(
            operation: "DeletePracticeRunConfiguration", 
            path: "/configuration/{resourceIdentifier}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the practice run configuration for a resource. Before you can delete a practice run configuration for a resource., you must disable zonal autoshift for the resource. Practice runs must be configured for zonal autoshift to be enabled.
    ///
    /// Parameters:
    ///   - resourceIdentifier: The identifier for the resource that you want to delete the practice run configuration for. The identifier is the Amazon Resource Name (ARN) for the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func deletePracticeRunConfiguration(
        resourceIdentifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeletePracticeRunConfigurationResponse {
        let input = DeletePracticeRunConfigurationRequest(
            resourceIdentifier: resourceIdentifier
        )
        return try await self.deletePracticeRunConfiguration(input, logger: logger)
    }

    /// Returns the status of the autoshift observer notification. Autoshift observer notifications notify you through Amazon EventBridge when there is an autoshift event for zonal autoshift. The status can be ENABLED or DISABLED. When ENABLED, a notification is sent when an autoshift is triggered. When DISABLED, notifications are not sent.
    @Sendable
    @inlinable
    public func getAutoshiftObserverNotificationStatus(_ input: GetAutoshiftObserverNotificationStatusRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetAutoshiftObserverNotificationStatusResponse {
        try await self.client.execute(
            operation: "GetAutoshiftObserverNotificationStatus", 
            path: "/autoshift-observer-notification", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the status of the autoshift observer notification. Autoshift observer notifications notify you through Amazon EventBridge when there is an autoshift event for zonal autoshift. The status can be ENABLED or DISABLED. When ENABLED, a notification is sent when an autoshift is triggered. When DISABLED, notifications are not sent.
    ///
    /// Parameters:
    ///   - logger: Logger use during operation
    @inlinable
    public func getAutoshiftObserverNotificationStatus(
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetAutoshiftObserverNotificationStatusResponse {
        let input = GetAutoshiftObserverNotificationStatusRequest(
        )
        return try await self.getAutoshiftObserverNotificationStatus(input, logger: logger)
    }

    /// Get information about a resource that's been registered for zonal shifts with Amazon Application Recovery Controller in this Amazon Web Services Region. Resources that are registered for zonal shifts are managed resources in ARC. You can start zonal shifts and configure zonal autoshift for managed resources.
    @Sendable
    @inlinable
    public func getManagedResource(_ input: GetManagedResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetManagedResourceResponse {
        try await self.client.execute(
            operation: "GetManagedResource", 
            path: "/managedresources/{resourceIdentifier}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get information about a resource that's been registered for zonal shifts with Amazon Application Recovery Controller in this Amazon Web Services Region. Resources that are registered for zonal shifts are managed resources in ARC. You can start zonal shifts and configure zonal autoshift for managed resources.
    ///
    /// Parameters:
    ///   - resourceIdentifier: The identifier for the resource that Amazon Web Services shifts traffic for. The identifier is the Amazon Resource Name (ARN) for the resource. Amazon Application Recovery Controller currently supports enabling the following resources for zonal shift and zonal autoshift:    Amazon EC2 Auto Scaling groups     Amazon Elastic Kubernetes Service     Application Load Balancer     Network Load Balancer
    ///   - logger: Logger use during operation
    @inlinable
    public func getManagedResource(
        resourceIdentifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetManagedResourceResponse {
        let input = GetManagedResourceRequest(
            resourceIdentifier: resourceIdentifier
        )
        return try await self.getManagedResource(input, logger: logger)
    }

    /// Returns the autoshifts for an Amazon Web Services Region. By default, the call returns only ACTIVE autoshifts. Optionally, you can specify the status parameter to return COMPLETED autoshifts.
    @Sendable
    @inlinable
    public func listAutoshifts(_ input: ListAutoshiftsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListAutoshiftsResponse {
        try await self.client.execute(
            operation: "ListAutoshifts", 
            path: "/autoshifts", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the autoshifts for an Amazon Web Services Region. By default, the call returns only ACTIVE autoshifts. Optionally, you can specify the status parameter to return COMPLETED autoshifts.
    ///
    /// Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - status: The status of the autoshift.
    ///   - logger: Logger use during operation
    @inlinable
    public func listAutoshifts(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        status: AutoshiftExecutionStatus? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListAutoshiftsResponse {
        let input = ListAutoshiftsRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            status: status
        )
        return try await self.listAutoshifts(input, logger: logger)
    }

    /// Lists all the resources in your Amazon Web Services account in this Amazon Web Services Region that are managed for zonal shifts in Amazon Application Recovery Controller, and information about them. The information includes the zonal autoshift status for the resource, as well as the Amazon Resource Name (ARN), the Availability Zones that each resource is deployed in, and the resource name.
    @Sendable
    @inlinable
    public func listManagedResources(_ input: ListManagedResourcesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListManagedResourcesResponse {
        try await self.client.execute(
            operation: "ListManagedResources", 
            path: "/managedresources", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all the resources in your Amazon Web Services account in this Amazon Web Services Region that are managed for zonal shifts in Amazon Application Recovery Controller, and information about them. The information includes the zonal autoshift status for the resource, as well as the Amazon Resource Name (ARN), the Availability Zones that each resource is deployed in, and the resource name.
    ///
    /// Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listManagedResources(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListManagedResourcesResponse {
        let input = ListManagedResourcesRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listManagedResources(input, logger: logger)
    }

    /// Lists all active and completed zonal shifts in Amazon Application Recovery Controller in your Amazon Web Services account in this Amazon Web Services Region. ListZonalShifts returns customer-initiated zonal shifts, as well as practice run zonal shifts that ARC started on your behalf for zonal autoshift. For more information about listing autoshifts, see "&gt;ListAutoshifts.
    @Sendable
    @inlinable
    public func listZonalShifts(_ input: ListZonalShiftsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListZonalShiftsResponse {
        try await self.client.execute(
            operation: "ListZonalShifts", 
            path: "/zonalshifts", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all active and completed zonal shifts in Amazon Application Recovery Controller in your Amazon Web Services account in this Amazon Web Services Region. ListZonalShifts returns customer-initiated zonal shifts, as well as practice run zonal shifts that ARC started on your behalf for zonal autoshift. For more information about listing autoshifts, see "&gt;ListAutoshifts.
    ///
    /// Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - nextToken: Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.
    ///   - resourceIdentifier: The identifier for the resource that you want to list zonal shifts for. The identifier is the Amazon Resource Name (ARN) for the resource.
    ///   - status: A status for a zonal shift. The Status for a zonal shift can have one of the following values:    ACTIVE: The zonal shift has been started and is active.    EXPIRED: The zonal shift has expired (the expiry time was exceeded).    CANCELED: The zonal shift was canceled.
    ///   - logger: Logger use during operation
    @inlinable
    public func listZonalShifts(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        resourceIdentifier: String? = nil,
        status: ZonalShiftStatus? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListZonalShiftsResponse {
        let input = ListZonalShiftsRequest(
            maxResults: maxResults, 
            nextToken: nextToken, 
            resourceIdentifier: resourceIdentifier, 
            status: status
        )
        return try await self.listZonalShifts(input, logger: logger)
    }

    /// Start an on-demand practice run zonal shift in Amazon Application Recovery Controller. With zonal autoshift enabled, you can start an on-demand practice run to verify preparedness at any time. Amazon Web Services also runs automated practice runs about weekly when you have enabled zonal autoshift. For more information, see  Considerations when you configure zonal autoshift in the Amazon Application Recovery Controller Developer Guide.
    @Sendable
    @inlinable
    public func startPracticeRun(_ input: StartPracticeRunRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartPracticeRunResponse {
        try await self.client.execute(
            operation: "StartPracticeRun", 
            path: "/practiceruns", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Start an on-demand practice run zonal shift in Amazon Application Recovery Controller. With zonal autoshift enabled, you can start an on-demand practice run to verify preparedness at any time. Amazon Web Services also runs automated practice runs about weekly when you have enabled zonal autoshift. For more information, see  Considerations when you configure zonal autoshift in the Amazon Application Recovery Controller Developer Guide.
    ///
    /// Parameters:
    ///   - awayFrom: The Availability Zone (for example, use1-az1) that traffic is shifted away from for the resource that you specify for the practice run.
    ///   - comment: The initial comment that you enter about the practice run. Be aware that this comment can be overwritten by Amazon Web Services if the automatic check for balanced capacity fails. For more information, see  Capacity checks for practice runs in the Amazon Application Recovery Controller Developer Guide.
    ///   - resourceIdentifier: The identifier for the resource that you want to start a practice run zonal shift for. The identifier is the Amazon Resource Name (ARN) for the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func startPracticeRun(
        awayFrom: String,
        comment: String,
        resourceIdentifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartPracticeRunResponse {
        let input = StartPracticeRunRequest(
            awayFrom: awayFrom, 
            comment: comment, 
            resourceIdentifier: resourceIdentifier
        )
        return try await self.startPracticeRun(input, logger: logger)
    }

    /// You start a zonal shift to temporarily move load balancer traffic away from an Availability Zone in an Amazon Web Services Region, to help your application recover immediately, for example, from a developer's bad code deployment or from an Amazon Web Services infrastructure failure in a single Availability Zone. You can start a zonal shift in ARC only for managed resources in your Amazon Web Services account in an Amazon Web Services Region. Resources are automatically registered with ARC by Amazon Web Services services. Amazon Application Recovery Controller currently supports enabling the following resources for zonal shift and zonal autoshift:    Amazon EC2 Auto Scaling groups     Amazon Elastic Kubernetes Service     Application Load Balancer     Network Load Balancer    When you start a zonal shift, traffic for the resource is no longer routed to the Availability Zone. The zonal shift is created immediately in ARC. However, it can take a short time, typically up to a few minutes, for existing, in-progress connections in the Availability Zone to complete. For more information, see Zonal shift in the Amazon Application Recovery Controller Developer Guide.
    @Sendable
    @inlinable
    public func startZonalShift(_ input: StartZonalShiftRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ZonalShift {
        try await self.client.execute(
            operation: "StartZonalShift", 
            path: "/zonalshifts", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// You start a zonal shift to temporarily move load balancer traffic away from an Availability Zone in an Amazon Web Services Region, to help your application recover immediately, for example, from a developer's bad code deployment or from an Amazon Web Services infrastructure failure in a single Availability Zone. You can start a zonal shift in ARC only for managed resources in your Amazon Web Services account in an Amazon Web Services Region. Resources are automatically registered with ARC by Amazon Web Services services. Amazon Application Recovery Controller currently supports enabling the following resources for zonal shift and zonal autoshift:    Amazon EC2 Auto Scaling groups     Amazon Elastic Kubernetes Service     Application Load Balancer     Network Load Balancer    When you start a zonal shift, traffic for the resource is no longer routed to the Availability Zone. The zonal shift is created immediately in ARC. However, it can take a short time, typically up to a few minutes, for existing, in-progress connections in the Availability Zone to complete. For more information, see Zonal shift in the Amazon Application Recovery Controller Developer Guide.
    ///
    /// Parameters:
    ///   - awayFrom: The Availability Zone (for example, use1-az1) that traffic is moved away from for a resource when you start a zonal shift. Until the zonal shift expires or you cancel it, traffic for the resource is instead moved to other Availability Zones in the Amazon Web Services Region.
    ///   - comment: A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.
    ///   - expiresIn: The length of time that you want a zonal shift to be active, which ARC converts to an expiry time (expiration time). Zonal shifts are temporary. You can set a zonal shift to be active initially for up to three days (72 hours). If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you're ready to restore traffic to the Availability Zone. To set a length of time for a zonal shift to be active, specify a whole number, and then one of the following, with no space:    A lowercase letter m: To specify that the value is in minutes.    A lowercase letter h: To specify that the value is in hours.   For example: 20h means the zonal shift expires in 20 hours. 120m means the zonal shift expires in 120 minutes (2 hours).
    ///   - resourceIdentifier: The identifier for the resource that Amazon Web Services shifts traffic for. The identifier is the Amazon Resource Name (ARN) for the resource. Amazon Application Recovery Controller currently supports enabling the following resources for zonal shift and zonal autoshift:    Amazon EC2 Auto Scaling groups     Amazon Elastic Kubernetes Service     Application Load Balancer     Network Load Balancer
    ///   - logger: Logger use during operation
    @inlinable
    public func startZonalShift(
        awayFrom: String,
        comment: String,
        expiresIn: String,
        resourceIdentifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ZonalShift {
        let input = StartZonalShiftRequest(
            awayFrom: awayFrom, 
            comment: comment, 
            expiresIn: expiresIn, 
            resourceIdentifier: resourceIdentifier
        )
        return try await self.startZonalShift(input, logger: logger)
    }

    /// Update the status of autoshift observer notification. Autoshift observer notification enables you to be notified, through Amazon EventBridge, when there is an autoshift event for zonal autoshift. If the status is ENABLED, ARC includes all autoshift events when you use the EventBridge pattern Autoshift In Progress. When the status is DISABLED, ARC includes only autoshift events for autoshifts when one or more of your resources is included in the autoshift. For more information, see  Notifications for practice runs and autoshifts in the Amazon Application Recovery Controller Developer Guide.
    @Sendable
    @inlinable
    public func updateAutoshiftObserverNotificationStatus(_ input: UpdateAutoshiftObserverNotificationStatusRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateAutoshiftObserverNotificationStatusResponse {
        try await self.client.execute(
            operation: "UpdateAutoshiftObserverNotificationStatus", 
            path: "/autoshift-observer-notification", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Update the status of autoshift observer notification. Autoshift observer notification enables you to be notified, through Amazon EventBridge, when there is an autoshift event for zonal autoshift. If the status is ENABLED, ARC includes all autoshift events when you use the EventBridge pattern Autoshift In Progress. When the status is DISABLED, ARC includes only autoshift events for autoshifts when one or more of your resources is included in the autoshift. For more information, see  Notifications for practice runs and autoshifts in the Amazon Application Recovery Controller Developer Guide.
    ///
    /// Parameters:
    ///   - status: The status to set for autoshift observer notification. If the status is ENABLED, ARC includes all autoshift events when you use the Amazon EventBridge pattern Autoshift In Progress. When the status is DISABLED, ARC includes only autoshift events for autoshifts when one or more of your resources is included in the autoshift.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateAutoshiftObserverNotificationStatus(
        status: AutoshiftObserverNotificationStatus,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateAutoshiftObserverNotificationStatusResponse {
        let input = UpdateAutoshiftObserverNotificationStatusRequest(
            status: status
        )
        return try await self.updateAutoshiftObserverNotificationStatus(input, logger: logger)
    }

    /// Update a practice run configuration to change one or more of the following: add, change, or remove the blocking alarm; change the outcome alarm; or add, change, or remove blocking dates or time windows.
    @Sendable
    @inlinable
    public func updatePracticeRunConfiguration(_ input: UpdatePracticeRunConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdatePracticeRunConfigurationResponse {
        try await self.client.execute(
            operation: "UpdatePracticeRunConfiguration", 
            path: "/configuration/{resourceIdentifier}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Update a practice run configuration to change one or more of the following: add, change, or remove the blocking alarm; change the outcome alarm; or add, change, or remove blocking dates or time windows.
    ///
    /// Parameters:
    ///   - allowedWindows: Add, change, or remove windows of days and times for when you can, optionally, allow ARC to start a practice run for a resource. The format for allowed windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple allowed windows with spaces. For example, say you want to allow practice runs only on Wednesdays and Fridays from noon to 5 p.m. For this scenario, you could set the following recurring days and times as allowed windows, for example: Wed-12:00-Wed:17:00 Fri-12:00-Fri:17:00.  The allowedWindows have to start and end on the same day. Windows that span multiple days aren't supported.
    ///   - blockedDates: Add, change, or remove blocked dates for a practice run in zonal autoshift. Optionally, you can block practice runs for specific calendar dates. The format for blocked dates is: YYYY-MM-DD. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Separate multiple blocked dates with spaces. For example, if you have an application update scheduled to launch on May 1, 2024, and you don't want practice runs to shift traffic away at that time, you could set a blocked date for 2024-05-01.
    ///   - blockedWindows: Add, change, or remove windows of days and times for when you can, optionally, block ARC from starting a practice run for a resource. The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when you specify dates, that dates and times for practice runs are in UTC. Also, be aware of potential time adjustments that might be required for daylight saving time differences. Separate multiple blocked windows with spaces. For example, say you run business report summaries three days a week. For this scenario, you might set the following recurring days and times as blocked windows, for example: MON-20:30-21:30 WED-20:30-21:30 FRI-20:30-21:30.
    ///   - blockingAlarms: Add, change, or remove the Amazon CloudWatch alarms that you optionally specify as the blocking alarms for practice runs.
    ///   - outcomeAlarms: Specify one or more Amazon CloudWatch alarms as the outcome alarms for practice runs.
    ///   - resourceIdentifier: The identifier for the resource that you want to update the practice run configuration for. The identifier is the Amazon Resource Name (ARN) for the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func updatePracticeRunConfiguration(
        allowedWindows: [String]? = nil,
        blockedDates: [String]? = nil,
        blockedWindows: [String]? = nil,
        blockingAlarms: [ControlCondition]? = nil,
        outcomeAlarms: [ControlCondition]? = nil,
        resourceIdentifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdatePracticeRunConfigurationResponse {
        let input = UpdatePracticeRunConfigurationRequest(
            allowedWindows: allowedWindows, 
            blockedDates: blockedDates, 
            blockedWindows: blockedWindows, 
            blockingAlarms: blockingAlarms, 
            outcomeAlarms: outcomeAlarms, 
            resourceIdentifier: resourceIdentifier
        )
        return try await self.updatePracticeRunConfiguration(input, logger: logger)
    }

    /// The zonal autoshift configuration for a resource includes the practice run configuration and the status for running autoshifts, zonal autoshift status. When a resource has a practice run configuration, ARC starts weekly zonal shifts for the resource, to shift traffic away from an Availability Zone. Weekly practice runs help you to make sure that your application can continue to operate normally with the loss of one Availability Zone. You can update the zonal autoshift status to enable or disable zonal autoshift. When zonal autoshift is ENABLED, you authorize Amazon Web Services to shift away resource traffic for an application from an Availability Zone during events, on your behalf, to help reduce time to recovery. Traffic is also shifted away for the required weekly practice runs.
    @Sendable
    @inlinable
    public func updateZonalAutoshiftConfiguration(_ input: UpdateZonalAutoshiftConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateZonalAutoshiftConfigurationResponse {
        try await self.client.execute(
            operation: "UpdateZonalAutoshiftConfiguration", 
            path: "/managedresources/{resourceIdentifier}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// The zonal autoshift configuration for a resource includes the practice run configuration and the status for running autoshifts, zonal autoshift status. When a resource has a practice run configuration, ARC starts weekly zonal shifts for the resource, to shift traffic away from an Availability Zone. Weekly practice runs help you to make sure that your application can continue to operate normally with the loss of one Availability Zone. You can update the zonal autoshift status to enable or disable zonal autoshift. When zonal autoshift is ENABLED, you authorize Amazon Web Services to shift away resource traffic for an application from an Availability Zone during events, on your behalf, to help reduce time to recovery. Traffic is also shifted away for the required weekly practice runs.
    ///
    /// Parameters:
    ///   - resourceIdentifier: The identifier for the resource that you want to update the zonal autoshift configuration for. The identifier is the Amazon Resource Name (ARN) for the resource.
    ///   - zonalAutoshiftStatus: The zonal autoshift status for the resource that you want to update the zonal autoshift configuration for. Choose ENABLED to authorize Amazon Web Services to shift away resource traffic for an application from an Availability Zone during events, on your behalf, to help reduce time to recovery.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateZonalAutoshiftConfiguration(
        resourceIdentifier: String,
        zonalAutoshiftStatus: ZonalAutoshiftStatus,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateZonalAutoshiftConfigurationResponse {
        let input = UpdateZonalAutoshiftConfigurationRequest(
            resourceIdentifier: resourceIdentifier, 
            zonalAutoshiftStatus: zonalAutoshiftStatus
        )
        return try await self.updateZonalAutoshiftConfiguration(input, logger: logger)
    }

    /// Update an active zonal shift in Amazon Application Recovery Controller in your Amazon Web Services account. You can update a zonal shift to set a new expiration, or edit or replace the comment for the zonal shift.
    @Sendable
    @inlinable
    public func updateZonalShift(_ input: UpdateZonalShiftRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ZonalShift {
        try await self.client.execute(
            operation: "UpdateZonalShift", 
            path: "/zonalshifts/{zonalShiftId}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Update an active zonal shift in Amazon Application Recovery Controller in your Amazon Web Services account. You can update a zonal shift to set a new expiration, or edit or replace the comment for the zonal shift.
    ///
    /// Parameters:
    ///   - comment: A comment that you enter about the zonal shift. Only the latest comment is retained; no comment history is maintained. A new comment overwrites any existing comment string.
    ///   - expiresIn: The length of time that you want a zonal shift to be active, which ARC converts to an expiry time (expiration time). Zonal shifts are temporary. You can set a zonal shift to be active initially for up to three days (72 hours). If you want to still keep traffic away from an Availability Zone, you can update the zonal shift and set a new expiration. You can also cancel a zonal shift, before it expires, for example, if you're ready to restore traffic to the Availability Zone. To set a length of time for a zonal shift to be active, specify a whole number, and then one of the following, with no space:    A lowercase letter m: To specify that the value is in minutes.    A lowercase letter h: To specify that the value is in hours.   For example: 20h means the zonal shift expires in 20 hours. 120m means the zonal shift expires in 120 minutes (2 hours).
    ///   - zonalShiftId: The identifier of a zonal shift.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateZonalShift(
        comment: String? = nil,
        expiresIn: String? = nil,
        zonalShiftId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ZonalShift {
        let input = UpdateZonalShiftRequest(
            comment: comment, 
            expiresIn: expiresIn, 
            zonalShiftId: zonalShiftId
        )
        return try await self.updateZonalShift(input, logger: logger)
    }
}

extension ARCZonalShift {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: ARCZonalShift, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension ARCZonalShift {
    /// Return PaginatorSequence for operation ``listAutoshifts(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listAutoshiftsPaginator(
        _ input: ListAutoshiftsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListAutoshiftsRequest, ListAutoshiftsResponse> {
        return .init(
            input: input,
            command: self.listAutoshifts,
            inputKey: \ListAutoshiftsRequest.nextToken,
            outputKey: \ListAutoshiftsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listAutoshifts(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - status: The status of the autoshift.
    ///   - logger: Logger used for logging
    @inlinable
    public func listAutoshiftsPaginator(
        maxResults: Int? = nil,
        status: AutoshiftExecutionStatus? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListAutoshiftsRequest, ListAutoshiftsResponse> {
        let input = ListAutoshiftsRequest(
            maxResults: maxResults, 
            status: status
        )
        return self.listAutoshiftsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listManagedResources(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listManagedResourcesPaginator(
        _ input: ListManagedResourcesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListManagedResourcesRequest, ListManagedResourcesResponse> {
        return .init(
            input: input,
            command: self.listManagedResources,
            inputKey: \ListManagedResourcesRequest.nextToken,
            outputKey: \ListManagedResourcesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listManagedResources(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - logger: Logger used for logging
    @inlinable
    public func listManagedResourcesPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListManagedResourcesRequest, ListManagedResourcesResponse> {
        let input = ListManagedResourcesRequest(
            maxResults: maxResults
        )
        return self.listManagedResourcesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listZonalShifts(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listZonalShiftsPaginator(
        _ input: ListZonalShiftsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListZonalShiftsRequest, ListZonalShiftsResponse> {
        return .init(
            input: input,
            command: self.listZonalShifts,
            inputKey: \ListZonalShiftsRequest.nextToken,
            outputKey: \ListZonalShiftsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listZonalShifts(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The number of objects that you want to return with this call.
    ///   - resourceIdentifier: The identifier for the resource that you want to list zonal shifts for. The identifier is the Amazon Resource Name (ARN) for the resource.
    ///   - status: A status for a zonal shift. The Status for a zonal shift can have one of the following values:    ACTIVE: The zonal shift has been started and is active.    EXPIRED: The zonal shift has expired (the expiry time was exceeded).    CANCELED: The zonal shift was canceled.
    ///   - logger: Logger used for logging
    @inlinable
    public func listZonalShiftsPaginator(
        maxResults: Int? = nil,
        resourceIdentifier: String? = nil,
        status: ZonalShiftStatus? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListZonalShiftsRequest, ListZonalShiftsResponse> {
        let input = ListZonalShiftsRequest(
            maxResults: maxResults, 
            resourceIdentifier: resourceIdentifier, 
            status: status
        )
        return self.listZonalShiftsPaginator(input, logger: logger)
    }
}

extension ARCZonalShift.ListAutoshiftsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ARCZonalShift.ListAutoshiftsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            status: self.status
        )
    }
}

extension ARCZonalShift.ListManagedResourcesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ARCZonalShift.ListManagedResourcesRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension ARCZonalShift.ListZonalShiftsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ARCZonalShift.ListZonalShiftsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token,
            resourceIdentifier: self.resourceIdentifier,
            status: self.status
        )
    }
}
